<?php
/**
 * tx009 网站文章发布系统
 */
 
//**** 初始化一些目录信息 ****//

    define('ROOT_PATH', dirname(__FILE__) . '/');
    
    require ROOT_PATH . 'config.php';  // 导入配置文件
    
    // 初始化
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 65);
    
    foreach($sessions as $session ){
        
    //==========================================初始化用户信息======================================
        $cookieVerify = "PHPSESSID=".$session['id'];
        curl_setopt($ch, CURLOPT_COOKIE, $cookieVerify);
        
        curl_setopt($ch, CURLOPT_URL, "http://www.tx009.com/fabu/lists_shang");
        $content = curl_exec($ch);
        $content = str_replace(array("\r\n", "\r", "\n"), "",$content);
        preg_match_all('/<tr(.*?)<\/tr>/',$content,$content);
        echo "<table>";
        print_r($content[0]);
        echo "</table>";
    }
    curl_close($ch);